package com.cn.lyl.servlet.company;

import com.alibaba.fastjson.JSONObject;
import com.cn.lyl.model.CompanyModel;
import com.cn.lyl.service.CompanyService;
import com.cn.lyl.service.impl.CompanyServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/back/company/findInfo")
public class FindCompanyServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("UTF-8");
        resp.setCharacterEncoding("UTF-8");
        CompanyService companyService=new CompanyServiceImpl();
        CompanyModel companyModel =companyService.find() ;
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("result",companyModel);
        resp.getWriter().print(jsonObject);
    }
}
